#ifndef __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__
#define __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__

//[Headers]     -- You can add your own extra header files here --
#include "../includes/includes.h"

#include "ContainerComponent.h"

#include "../extras/menu/CircularMenu.h"

#include "../elements/RootElement.h"

#include "../elements/FileProcessorElement.h"

#include "SimpleLabel.h"

#include "LayoutManager.h"

#include "FolderComponent.h"

//[/Headers]


class MainComponent  : public Component,
					   public DragAndDropContainer
{
public:
    //==============================================================================
	MainComponent (RootElement * root_);
    ~MainComponent();

    void paint (Graphics& g);
    void resized();
    
	void mouseDown(const MouseEvent &e);

	void showTitle(ElementComponent * element);
	void hideTitle();

	void containerVisibilityChanged(ContainerElement * containerElement);

	void folderVisibilityChanged(FileProcessorElement * element);

	void removeElement(ElementComponent * element);

	void moveElement(ElementComponent * elementToMove, ElementComponent * target);

	ContainerComponent * findContainerFrom(ContainerComponent * from, ContainerElement * what);

	ContainerComponent * getRootContainer();

	void removeUselessChildContainers(ElementComponent * except);

    //==============================================================================
    juce_UseDebuggingNewOperator

private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    //[/UserVariables]

	void recursiveRemoveContainers(ContainerComponent * root, ElementComponent * except);

    //==============================================================================
	ContainerComponent * rootContainer;

	RootElement * root;

	SimpleLabel * title;
	ElementComponent * elementToShowText;

	FolderComponent * folderComponent;

	LayoutManager * layoutManager;

    //==============================================================================
    // (prevent copy constructor and operator= being generated..)
    MainComponent (const MainComponent&);
    const MainComponent& operator= (const MainComponent&);
};


#endif   // __JUCER_HEADER_MAINCOMPONENT_MAINCOMPONENT_D0F6CD31__
